package com.lams.action.archive;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.lams.action.SubAction;
import com.lams.service.archive.IRepairFacade;
import com.lams.util.ResultEntity;
import com.opensymphony.xwork2.ActionContext;

public class RepairAction extends SubAction {
	private static final long serialVersionUID = -1829686600874050660L;
	private IRepairFacade apf ;
	private String REPAIR_ID ;
	private String REPAIR_USER_ID ;
	private String REPAIR_USER_NAME ;
	private String REPAIR_CLASS ;
	private String FAULT_DESCRIBE ;
	private String FAULT_PRINCIPAL_ID ;
	private String FAULT_PRINCIPAL ;
	private String REPAIR_TIME ;
	private String FAULT_STATUS ;
	private String DISPOSE_STAFF ;
	private String DISPOSE_TIME ;
	private String REPAIR_IP ;
	private String CONDUCT_PROCESS ;
	private String FAULT_CONFINES ;
	private String SHOWW ;
	private String NAME ;
	private String SESSIONname ;
	private String PROCESSING_ACTIONS;
	private String PROCESSING_MEMO;
	private String ESTIMATE ;
	private String ESTIMATE_MEMO ;
	private Map params = new HashMap();
	
	public String sessionRepair (){
		ResultEntity result = apf.sessionRepair();
		//System.out.println("#########################################################################"+result);
		this.setResult(ResultEntity.decode(result));
		return SUCCESS;
	}
	
	public String queryRepair(){
		ResultEntity result = apf.queryRepair(params,this.getStart(), this.getLimit());
		//System.out.println("#########################################################################"+result);
		this.setResult(ResultEntity.decode(result));
		return SUCCESS;
	}
	
	public String queryRepairStaff(){
		ResultEntity result = apf.queryRepairStaff(params,this.getStart(), this.getLimit());
		//System.out.println("#########################################################################"+result);
		this.setResult(ResultEntity.decode(result));
		return SUCCESS;
	}
	
	public String add() {	
		//HttpServletRequest request = ServletActionContext.getRequest();
		List list = new ArrayList();
		ResultEntity result = apf.addRepair(params, this.getREPAIR_ID()==null||"".equals(this.getREPAIR_ID())||"-1".equals(this.getREPAIR_ID())?"add":"update");
		result.setData(list);
		this.setResult(ResultEntity.decode(result));
		return SUCCESS;
	}
	
	public String deleteRepair(){
		ResultEntity result = apf.deleteRepair(params,"delete");
		this.setResult(ResultEntity.decode(result));
		return SUCCESS;
	}

	public IRepairFacade getApf() {
		return apf;
	}

	public void setApf(IRepairFacade apf) {
		this.apf = apf;
	}

	public String getREPAIR_ID() {
		return REPAIR_ID==null||"".equals(REPAIR_ID)?"-1":REPAIR_ID;
	}

	public void setREPAIR_ID(String rEPAIR_ID) {
		REPAIR_ID = rEPAIR_ID;
		params.put("REPAIR_ID", REPAIR_ID);
	}

	public String getREPAIR_USER_NAME() {
		return REPAIR_USER_NAME;
	}

	public void setREPAIR_USER_NAME(String rEPAIR_USER_NAME) {
		REPAIR_USER_NAME = rEPAIR_USER_NAME;
//		params.put("REPAIR_USER_NAME", REPAIR_USER_NAME);
		params.put("REPAIR_USER_NAME", "".equals(REPAIR_USER_NAME)?"-1":REPAIR_USER_NAME);
	}

	public String getREPAIR_CLASS() {
		return REPAIR_CLASS;
	}

	public void setREPAIR_CLASS(String rEPAIR_CLASS) {
		REPAIR_CLASS = rEPAIR_CLASS;
		params.put("REPAIR_CLASS", REPAIR_CLASS);
	}

	public String getFAULT_DESCRIBE() {
		return FAULT_DESCRIBE;
	}

	public void setFAULT_DESCRIBE(String fAULT_DESCRIBE) {
		FAULT_DESCRIBE = fAULT_DESCRIBE;
		params.put("FAULT_DESCRIBE", FAULT_DESCRIBE);
	}

	public String getFAULT_PRINCIPAL() {
		return FAULT_PRINCIPAL;
	}

	public void setFAULT_PRINCIPAL(String fAULT_PRINCIPAL) {
		FAULT_PRINCIPAL = fAULT_PRINCIPAL;
		params.put("FAULT_PRINCIPAL", FAULT_PRINCIPAL);
	}

	public String getREPAIR_TIME() {
		return REPAIR_TIME;
	}

	public void setREPAIR_TIME(String rEPAIR_TIME) {
		REPAIR_TIME = rEPAIR_TIME;
		params.put("REPAIR_TIME", REPAIR_TIME);
	}

	public String getFAULT_STATUS() {
		return FAULT_STATUS;
	}

	public void setFAULT_STATUS(String fAULT_STATUS) {
		FAULT_STATUS = fAULT_STATUS;
		params.put("FAULT_STATUS", "".equals(FAULT_STATUS)?"-1":FAULT_STATUS);
	}

	public String getDISPOSE_STAFF() {
		return DISPOSE_STAFF;
	}

	public void setDISPOSE_STAFF(String dISPOSE_STAFF) {
		DISPOSE_STAFF = dISPOSE_STAFF;
		params.put("DISPOSE_STAFF", DISPOSE_STAFF);
	}

	public String getDISPOSE_TIME() {
		return DISPOSE_TIME;
	}

	public void setDISPOSE_TIME(String dISPOSE_TIME) {
		DISPOSE_TIME = dISPOSE_TIME;
		params.put("DISPOSE_TIME", DISPOSE_TIME);
	}

	public String getREPAIR_IP() {
		return REPAIR_IP;
	}

	public void setREPAIR_IP(String rEPAIR_IP) {
		REPAIR_IP = rEPAIR_IP;
		params.put("REPAIR_IP", REPAIR_IP);
	}

	public String getCONDUCT_PROCESS() {
		return CONDUCT_PROCESS;
	}

	public void setCONDUCT_PROCESS(String cONDUCT_PROCESS) {
		CONDUCT_PROCESS = cONDUCT_PROCESS;
		params.put("CONDUCT_PROCESS", CONDUCT_PROCESS);
	}

	public String getFAULT_CONFINES() {
		return FAULT_CONFINES;
	}

	public void setFAULT_CONFINES(String fAULT_CONFINES) {
		FAULT_CONFINES = fAULT_CONFINES;
		params.put("FAULT_CONFINES", FAULT_CONFINES);
	}
	
	public String getSHOWW() {
		return SHOWW;
	}

	public void setSHOWW(String sHOWW) {
		NAME = sHOWW;
		params.put("SHOWW", SHOWW);
	}
	
	public String getREPAIR_USER_ID() {
		return REPAIR_USER_ID;
	}

	public void setREPAIR_USER_ID(String rEPAIR_USER_ID) {
		REPAIR_USER_ID = rEPAIR_USER_ID;
		params.put("REPAIR_USER_ID", REPAIR_USER_ID);
	}

	public String getFAULT_PRINCIPAL_ID() {
		return FAULT_PRINCIPAL_ID;
	}

	public void setFAULT_PRINCIPAL_ID(String fAULT_PRINCIPAL_ID) {
		FAULT_PRINCIPAL_ID = fAULT_PRINCIPAL_ID;
		params.put("FAULT_PRINCIPAL_ID", FAULT_PRINCIPAL_ID);
	}

	public String getNAME() {
		return NAME;
	}

	public void setNAME(String nAME) {
		NAME = nAME;
		params.put("NAME", NAME);
	}

	public String getSESSIONname() {
		return SESSIONname;
	}

	public void setSESSIONname(String sESSIONname) {
		SESSIONname = sESSIONname;
		params.put("SESSIONname", SESSIONname);
	}
	
	public String getPROCESSING_ACTIONS() {
		return PROCESSING_ACTIONS;
	}

	public void setPROCESSING_ACTIONS(String pROCESSING_ACTIONS) {
		PROCESSING_ACTIONS = pROCESSING_ACTIONS;
		params.put("PROCESSING_ACTIONS", "".equals(PROCESSING_ACTIONS)?"-1":PROCESSING_ACTIONS);
	}

	public String getPROCESSING_MEMO() {
		return PROCESSING_MEMO;
	}

	public void setPROCESSING_MEMO(String pROCESSING_MEMO) {
		PROCESSING_MEMO = pROCESSING_MEMO;
		params.put("PROCESSING_MEMO", PROCESSING_MEMO);
	}
	
	

	public String getESTIMATE() {
		return ESTIMATE;
	}

	public void setESTIMATE(String eSTIMATE) {
		ESTIMATE = eSTIMATE;
		params.put("ESTIMATE", "".equals(ESTIMATE)?"-1":ESTIMATE);
	}

	public String getESTIMATE_MEMO() {
		return ESTIMATE_MEMO;
	}

	public void setESTIMATE_MEMO(String eSTIMATE_MEMO) {
		ESTIMATE_MEMO = eSTIMATE_MEMO;
		params.put("ESTIMATE_MEMO", ESTIMATE_MEMO);
	}

	public Map getParams() {
		return params;
	}

	

	

	

	//public String addOrUpdateFunction(){
	//	ResultEntity result = apf.addOrUpdateFunction(params);
	//	this.setResult(ResultEntity.decode(result));
	//	return SUCCESS;
	//}
	
	

}
